import axios from '@/utils/request.js'

// 注册
export const userReg = (data) => {
        return axios({
                url: '/api/reg',
                method: 'post',
                data
        })
}
// 登录
export const userLogin = (data) => {
        return axios({
                url: '/api/login',
                method: 'post',
                data
        })
}
// 用户信息
export const getUserInfo = () => {
        return axios({
                url: '/my/userinfo',
        })
}
// 更新用户信息
export const editUserInfo = (data) => {
        return axios({
                url: '/my/userinfo',
                method: 'put',
                data
        })
}
// 更新用户头像
export const editUserAvatar = (data) => {
        return axios({
                url: '/my/update/avatar',
                method: 'PATCH',
                data
        })
}
// 更新用户密码
export const updatePassword = (data) => {
        return axios({
                url: '/my/updatepwd',
                method: 'PATCH',
                data
        })
}

